package org.example.gui.widget;

import javax.swing.*;
import java.awt.*;

public class BudgetProgressBar extends JProgressBar {
    public BudgetProgressBar() {
        this.setStringPainted(true);
        this.setFont(new Font(null, Font.BOLD, 20));
    }


    /**
     * 设置进度（当月消费金额 除以 预算）
     */
    public void setProgress(int progress) {
        this.setValue(progress);
        this.setString(progress + "%");

        this.repaint();
    }
}
